package com.redmaple.controller;

import com.redmaple.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author redMaple-gi
 * @Date 2020/7/7 15:47
 * @Version 1.0
 */
@RestController
public class SpringbootRedisController {

    @Autowired
    private RedisUtil redisUtil;

    @GetMapping("/setVlue")
    public String setValue(String key, String value){
        redisUtil.setString(key, value);
        System.out.println("====操作成功 key:" +key +" value:" + value);
        return "操作成功 key:" +key +" value:" + value;
    }

    @GetMapping("/getValue")
    public String getValue(String key){
        return redisUtil.getString(key);
    }

}